package com.hyts.reactor.handler.reactor;

import com.hyts.reactor.handler.subcribe.Subscriber;
import lombok.Data;

import java.util.function.Function;

/**
 * project-name:coffice-toolbox
 * package-name:com.hyts.reactor.handler.reactor
 * author:Libo/Alex
 * create-date:2019-06-25 15:35
 * email:liboware@gmail.com
 * description:此类主要用于: reactor map模型的构建器
 */
@Data
public class ReactorMapProductor<T, R> extends ReactorProducer<T> {

    /**
     * 源source productor对象构建器
     */
    private final ReactorProducer<? extends T> source;

    /**
     * function对象转换器函数
     */
    private final Function<? super T, ? extends R> mapper;


    @Override
    protected void register(Subscriber<? super T> subscriber) {
        source.register(subscriber);
    }
}
